package com.cjk.foundation.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.cjk.foundation.entity.FlowLogEntity;
import com.cjk.foundation.entity.SysInfoLogEntity;

@Repository
public interface LogDao {

	public void insertSysInfoLog(SysInfoLogEntity sysInfoLogEntity);
	
	public void insertFlowLog(FlowLogEntity flowLogEntity);
	
	@Select("select * from sysinfo_log where sn = #{sn} order by create_time desc limit 1")
	@ResultMap("sysinfoMap")
	public SysInfoLogEntity selectLastBySn(@Param("sn") String sn);
	
	@ResultMap("flowLogMap")
	@Select("select * from flow_log where sn = #{sn} order by create_time desc limit 10")
	public List<FlowLogEntity> selectFlowLogBySn(@Param("sn") String sn);
	
}
